package utn.frd;

import java.io.IOException;
import javax.servlet.http.*;

import utn.frd.domain.Student;
import utn.frd.persistence.DataManager;

@SuppressWarnings("serial")
public class PersonalDataServlet extends HttpServlet {
	
	DataManager dm = new DataManager();
	
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		String name = req.getParameter("name");
		String email = req.getParameter("email");
		
		Student student = new Student(email, name);
		dm.saveStudent(student);
		
		
		resp.setContentType("text/plain");
		resp.getWriter().println("Personal Data Servlet it's works");
	}
}
